//
//  File.swift
//  OnemeetingDemo
//
//  Created by 张衡 on 2020/4/10.
//  Copyright © 2020 www.onemeeting.1meetingIos. All rights reserved.
//

import Foundation

class File: NSObject {
    
    class func isfileExists(path:String) -> Bool{
        let  fileManager = FileManager.default
        let result = fileManager.fileExists(atPath: path)

        if result {
            return true
        }else{
            return false
        }
    }

    class func creatFilePath(path:String) {
        let  fileManager = FileManager.default
        do{
            // 创建文件夹   1，路径 2 是否补全中间的路劲 3 属性
            try fileManager.createDirectory(atPath: path, withIntermediateDirectories: true, attributes: nil)

            //创建文件    1 路径  2 内容 3 属性
            //try fileManager.createFile(atPath: path, contents: nil, attributes: nil)
        } catch{
            print("creat false")
        }
    }

    class func removeFilePath(path:String){
        let  fileManager = FileManager.default
        do{
            try fileManager.removeItem(atPath: path)
        } catch{
            print("creat false")
        }
    }


}
